package com
{
	import com.controller.DeleteUserCommand;
	import com.controller.StartupCommand;
	
	import org.puremvc.as3.interfaces.IFacade;
	import org.puremvc.as3.patterns.facade.Facade;

	public class ApplicationFacade extends Facade implements IFacade
	{
		public static const STARTUP:String           = 'startup';
		public static const NEW_USER:String 		= "newUser";
		public static const DELETE_USER:String 		= "deleteUser";
		public static const USER_SELECTED:String	= "userSelected";
		public static const USER_ADDED:String		= "userAdded";
		public static const USER_UPDATED:String		= "userUpdated";
		public static const USER_DELETED:String      = "userDeleted";
		public static const CANCEL_SELECTED:String	= "cancelSelected";
		public function getInstance():ApplicationFacade
		{
		    if(instance == null) instance = new ApplicationFacade();
		    return instance as ApplicationFacade;
		}
		public function startup(app:Object):void
		{
		    sendNotification(STARTUP,app);
		}
		override protected function initializeController():void
		{
		    super.initializeController();		
			registerCommand( STARTUP,StartupCommand);
			registerCommand( DELETE_USER,DeleteUserCommand );
		}
	}
}